package com.baiwei.vpnapi.utils;

import sun.java2d.pipe.SpanShapeRenderer;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @program: vpnapi
 * @description: 时间字符串转换
 * @author: Mr. Stone
 * @create: 2020-02-27 06:08
 **/
public class DateUtil {
    public static String dateToFullString(Date date){
        SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
        return format.format(date);
    }
    public static String nowToFullString() {
        return dateToFullString(new Date());
    }
    public static Integer secondsBetween(Date start, Date end) {
        long startSec = start.getTime()/1000;
        long endSec = end.getTime()/1000;
        return (int)(endSec - startSec);
    }
}
